<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"
	contentType="text/html; charset=UTF-8"%>
<%@taglib prefix="s" uri="/struts-tags"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglib prefix="pg" uri="http://jsptags.com/tags/navigation/pager"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<base href="<%=basePath%>">

		<title>合众人寿公益平台客户管理系统</title>


		<meta http-equiv="pragma" content="no-cache">
		<meta http-equiv="cache-control" content="no-cache">
		<meta http-equiv="expires" content="0">
		<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
		<meta http-equiv="description" content="This is my page">
		
		<SCRIPT type="text/javascript">
	      var GB_ROOT_DIR = "<%=request.getContextPath()%>/html/skin/";
        </SCRIPT>	
		<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
		<link href="<%= request.getContextPath() %>/html/css/Main.css"
			rel="stylesheet" type="text/css" />
		<link href="<%=request.getContextPath()%>/html/css/gb_styles.css"
			rel="stylesheet" type="text/css"/>
		<script src="<%=request.getContextPath()%>/html/js/Calendar.js"
			charset="utf-8"></script>
			<script type="text/javascript"
			src="<%=request.getContextPath()%>/html/js/AJS.js"></script>
		<script type="text/javascript"
			src="<%=request.getContextPath()%>/html/js/AJS_fx.js"></script>
		<script type="text/javascript"
			src="<%=request.getContextPath()%>/html/js/gb_scripts.js"></script>
		
		<!-- Dwr Js -->
		<script
			src="<%= request.getContextPath() %>/dwr/interface/organizationAction.js"
			type="text/javascript"></script>
		<script src="<%= request.getContextPath() %>/dwr/engine.js"
			type="text/javascript"></script>
		<script src="<%= request.getContextPath() %>/dwr/util.js"
			type="text/javascript"></script>
		<script src="<%= request.getContextPath() %>/html/js/subCityUtil.js"
			type="text/javascript"></script>
		<link href="<%=request.getContextPath()%>/html/js/My97DatePicker/skin/WdatePicker.css"
			rel="stylesheet" type="text/css" />
		<script src="<%=request.getContextPath()%>/html/js/My97DatePicker/WdatePicker.js"
			charset="utf-8"></script>
		<style>
body,ul,ol,dl,dd,p,h1,h2,h3,h4,h5,h6,form,input,textarea,select,td,th {
	margin: 0;
	padding: 0;
	font-family: "宋体", Arial, Helvetica, sans-serif;
}

li {
	list-style: none;
}

input {
	background: none;
}

.clear {
	zoom: 1;
}

.clear:after {
	content: "";
	display: block;
	clear: both;
}
</style>
	</head>

	<body>
		<div class="container">
			<div class="wrap clear">
				<div class="sub_wp_right">
					<div class="rt_tt">
						<h3 class="tittle">
							学生列表
						</h3>
					</div>
					<div class="ct">
						<form
							action="<%=request.getContextPath()%>/student/searchStudents.do"
							method="post" name="listForm" onsubmit="return check();">
							<h3 class="sm_tt">
								查询条件
							</h3>

							<div class="tiaojian">
								<ul class="clear">
								     <li>
										<span>分公司：</span>
											<select name="student.subCompany" onchange="ajaxSubmit()"
											id="subCompany">
												<option selected="selected" value="No">
													不限
												</option>
												<s:iterator value="#session.barchList" var="organ">
													<option value="<s:property value="#organ.um_organ_id" />"
													         <c:if test="${student.subCompany eq organ.um_organ_id }">selected</c:if> >
														<s:property value="#organ.abbr_name" />
													</option>
												</s:iterator>
											</select>
									</li>
									 <li>
										<span>中支：</span>
											<select name="student.subCity" id="subCity">
												<option selected="selected" value="No">
													不限
												</option>
												<s:iterator value="#session.expensedList" var="organ">
												<option value="<s:property value="#organ.um_organ_id" />"
													<c:if test="${student.subCity eq organ.um_organ_id }">selected</c:if>>
													<s:property value="#organ.abbr_name" />
												</option>
											  </s:iterator> 
											</select>
											<input type="hidden" value="${subCityHidden}" name="subCityHidden" id="subCityHidden" />
									</li>
									<li>
											<span>姓名：</span>
											<input type="text" name="student.name" value="${student.name }"/>
									</li>
									<li>
											<span>性别：</span>
											<select name="student.gender" style="width: 155;">
												<option value="No">
													不限
												</option>
												<option value="男" <c:if test="${student.gender eq '男' }">selected</c:if>>
													男
												</option>
												<option value="女" <c:if test="${student.gender eq '女' }">selected</c:if>>
													女
												</option>
											</select>
									</li>
									 <li>
										    <span>产生时间：</span>
										    <input type="text" name="startcreate" id="startcreate"  onfocus="WdatePicker({startcreate:'%y-%M-%d',dateFmt:'yyyy-MM-dd'})" readonly="readonly"
												class="txt" value="${startcreate}"/>
										 </li>
										 <li>
										    <span>至：</span>
										    <input type="text" name="endcreate" id="endcreate"  onfocus="WdatePicker({endcreate:'%y-%M-%d',dateFmt:'yyyy-MM-dd'})" readonly="readonly"
												class="txt" value="${endcreate}"/>
										 </li>
								</ul>
								<div class="btn">
									<input type="submit" value="查询" name = "search" onclick="setButtonType(this)"/>
								</div>
                                   <input type="hidden" id="buttonType" name="buttonType">
							    </div>
							<div class="btn2">
								<input type="button" value="批量导出" name="exp" onclick="setButtonType(this)" />
							</div>
							<s:property
								value="@com.ulic.customerManApplication.pager.PagerTag@getStart('学生列表', #request.pm)"
								escape="false" />
							<div class="jieguo">
								<table border="0" cellpadding="0" cellspacing="0"
									class="listArea" width="100%">
									<thead>
										<tr>
											<th>
												姓名
											</th>
											<th>
												性别
											</th>
											<th>
												分公司
											</th>
											<th>
												中支
											</th>
											<th>
												学校
											</th>
											<th>
												创建时间
											</th>
											<th>
												操作
											</th>
										</tr>
									</thead>
									<tbody id="bg">
										<s:if test="#request.pm.datas.size()==0">
											<tr>
												<td colspan="14" align="center">
													<font color="red">暂无数据！</font>
												</td>
											</tr>
										</s:if>
										<s:else>
											<s:iterator value="#request.pm.datas" var="student"
												status="status">
												<s:if test="#status.odd == true">
													<tr class="rowNormal"
														onmouseover="this.className='rowChecked'"
														onmouseout="this.className='rowNormal'">
												</s:if>
												<s:else>
													<tr class="rowAlternate"
														onmouseover="this.className='rowChecked'"
														onmouseout="this.className='rowAlternate'">
												</s:else>
													<td align="center">
														<s:property value="#student.name" />
													</td>
													<td align="center">
														<s:property value="#student.gender" />
													</td>
													<td align="center">
														<s:property value="#student.subComName" />
													</td>
													<td align="center">
														<s:property value="#student.subCityName" />
													</td>
													<td align="center">
														<s:property value="#student.school" />
													</td>

													<td align="center">
														<s:date name="#student.createDate" format="yyyy-MM-dd HH:mm:ss" />
													</td>
													<td align="center">
														<a
															href="<%=request.getContextPath()%>/student/viewStudent.do?student.id=<s:property value="#student.id"/>">查看</a>
														<a
															href="<%=request.getContextPath()%>/student/updateStudent.do?student.id=<s:property value="#student.id"/>">修改</a>
														<a
															href="javascript:deleteStudent(<s:property value="#student.id"/>);">删除</a>
													</td>
												</tr>
											</s:iterator>
										<tr>
										  <td colspan="7" align="center">
										     捐助学生数量共 <s:property value="#request.pm.total" /> 位
										  </td>
										</tr>
										</s:else>
									</tbody>
								</table>
							</div>
							<s:property
								value="@com.ulic.customerManApplication.pager.PagerTag@getEnd(#request.pm)"
								escape="false" />
						</form>
					</div>
				</div>
			</div>
		</div>
	</body>
	<script type="text/javascript">
	  <%
	 String rolename = (String)session.getAttribute("rolename");
	 if(!"THIRDADMIN".equals(rolename)){
	%>
    ajaxSubmit();
    <%}%>
	
    function deleteStudent(id){
  		if(confirm("是否确认删除？")){
  			window.location.href="<%=request.getContextPath()%>/student/deleteStudent.do?student.id="+id;
  		}
  	}
  	
  </script>
</html>
